<?php

namespace App\Http\Requests\Api;

class ResumeInfoRequest extends ApiRequest
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'name' => 'required',
            'sex' => 'bail|required|integer|between:0,2',
            'birthday' => 'bail|required|before:now',
            'education' => 'bail|required|integer',
            'work_year' => 'bail|required|integer',
            'homeaddress' => 'integer',
            'job_status' => 'bail|required|integer|between:1,4',
            'mobile' => 'bail|required|mobile_verification',
            'email' => 'email',
            'qq' => 'check_qq',
        ];
    }

    public function attributes()
    {
        return [
            'name' => '姓名',
            'sex' => '性别',
            'birthday' => '生日',
            'education' => '学历',
            'work_year' => '相关工作经验',
            'homeaddress' => '现住址',
            'job_status' => '求职状态',
            'mobile' => '手机',
            'email' => '邮箱',
        ];
    }

    public function messages()
    {
        return array_merge(parent::messages(),[
            'birthday.before'=>':attribute不能小于现在',
            'mobile.mobile_verification'=>'请输入正确的手机号码',
            'qq.check_qq'=>'请输入正确的qq号码',
        ]);
    }
}
